package com.supermarket.kafka.generator;

//作用：表示一条商品的实时记录，包含动态变化的业务数据
//数据关系：
//sold ≤ inStock（已售数量不超过库存）
//status 由库存和业务规则决定

public class ProductRecord {
    private int id; //用户id
    private int productId; //商品id
    private String productName; //商品名称
    private int inStock; //商品库存
    private int favorLevel; //喜爱程度
    private int sold; //销量
    private char status; //商品状态

    // Getters and Setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }

    public int getProductId() { return productId; }
    public void setProductId(int productId) { this.productId = productId; }

    public String getProductName() { return productName; }
    public void setProductName(String productName) { this.productName = productName; }

    public int getInStock() { return inStock; }
    public void setInStock(int inStock) { this.inStock = inStock; }

    public int getFavorLevel() { return favorLevel; }
    public void setFavorLevel(int favorLevel) { this.favorLevel = favorLevel; }

    public int getSold() { return sold; }
    public void setSold(int sold) { this.sold = sold; }

    public char getStatus() { return status; }
    public void setStatus(char status) { this.status = status; }

    @Override
    public String toString() {
        return id + "\t" + productId + "\t" + productName + "\t" +
                inStock + "\t" + favorLevel + "\t" + sold + "\t" + status;
    }
}